package com.autumn.platform.dao.dialect;

import java.sql.SQLException;
import java.util.Properties;

import javax.sql.DataSource;

import org.apache.ibatis.mapping.DatabaseIdProvider;

public class DialectDatabaseIdProvider implements DatabaseIdProvider {

    /**
     * 获取数据库产品的简写名称
     */
    @Override
    public String getDatabaseId(DataSource dataSource) throws SQLException {
        IDialect dialect = Dialects.getDialect(dataSource);
        return dialect.getDatabaseId();
    }

    @Override
    public void setProperties(Properties p) {}
}
